home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / cenviw1.zip / MSGBOXES.CMM < prev    next >
Text File  |  1993-06-14  |  1KB  |  31 lines

  1. /*************************************************************
  2.  *** MsgBoxes - Sample Cmm code to demonstrate uses of the ***
  3.  ***            MessageBox() function.                     ***
  4.  *************************************************************/
  5. #include <MsgBox.lib>
  6.  
  7.  
  8. MessageBox("The following samples show various ways\n"
  9.            "to use the Windows MessageBox() function.\n"
  10.            "A wrapper for MessageBox() is located in\n"
  11.            "the Cmm library: \"MsgBox.lib\"",
  12.            "MsgBoxes - Welcome!");
  13.  
  14. MessageBox("This example only passes 1 parameter: the message string.");
  15.  
  16. MessageBox("This passes the message string and a title.","Here is the title.");
  17.  
  18. MessageBox("This example passes a zero-length string to get no title.","");
  19.  
  20. switch ( MessageBox("You can also offer different choices.\nPick one now...",
  21.                     "MessageBox() choices",
  22.                     MB_YESNOCANCEL) ) {
  23.    case IDYES:    button = "Yes";   break;
  24.    case IDNO:     button = "No";    break;
  25.    case IDCANCEL: button = "Cancel";   break;
  26. }
  27.  
  28. sprintf(message,"You selected the %s button",button);
  29. MessageBox(message,"");
  30.            
  31.